package com.dragon.datastructure.linkedlist;

/**
 * 虚拟头节点单链表测试案例
 *
 * @author dragon
 * @since 2019/11/20
 */
public class DummyHeadSingleLinkedListTest {

    public static void main(String[] args) {
        DummyHeadSingleLinkedList<Integer> linkedList = new DummyHeadSingleLinkedList<>();
        linkedList.addLast(10);
        linkedList.addLast(20);
        linkedList.addLast(30);
        linkedList.add(1, 40);
        linkedList.addFirst(50);
        System.out.println(linkedList.toString());
        linkedList.remove(2);
        linkedList.remove(1);
        System.out.println(linkedList.toString());
        linkedList.add(33);
        System.out.println(linkedList);
        linkedList.remove(new Integer(40));
        System.out.println(linkedList);
        linkedList.remove(new Integer(50));
        System.out.println(linkedList);

        System.out.println(linkedList.contains(33));
        System.out.println(linkedList.contains(50));
    }
}
